package cn.com.open.itembank.common;

import cn.com.open.itembank.dto.QuestionModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by lucky on 2017/9/13.
 */
public class ModelTransfer {

    private ModelTransfer() {
    }

    //region 根据试题输出模型得到word输出map

    /**
     * 根据试题输出模型得到word输出map.
     *
     * @param questionModel 试题输出模型
     * @return the data map
     */
    public static Map<String, Boolean> getDataMap(QuestionModel questionModel) {
        //创建一个linkedList集合
        Map<String, Boolean> dataMap = new LinkedHashMap<>();

        //题干
        dataMap.put(questionModel.getI2(), true);
        //选项
        dataMap.put(String.join(",",questionModel.getI6()), true);

//        if(isSub){
//            List<QuestionModel> subList = questionModel.getSub();
//            for(QuestionModel sub : subList){
//                dataMap.put(sub.getI2(), true);
//                //选项
//                dataMap.put(String.join(",",sub.getI6()), true);
//                //答案
//                dataMap.put(String.join(",",sub.getI7()), false);
//            }
//        }

        dataMap.put("", false);

        return dataMap;
    }
    //endregion
}
